import { Line } from '@ant-design/plots';
import React from 'react';

const BaseLine: React.FC<{ data: { type: string; value: number }[] }> = (props) => {
  const { data = [] } = props;
  const config = {
    data,
    xField: 'type',
    yField: 'value',
    point: {
      shapeField: 'square',
      sizeField: 4,
    },
    interaction: {
      tooltip: {
        marker: false,
      },
    },
    style: {
      lineWidth: 2,
    },
    tooltip: {
      items: [
        { channel: 'y', name: '销售额' },
        { channel: 'x', name: '月份' },
      ],
    },
  };
  return <Line {...config} />;
};

export default BaseLine;
